﻿using BusinessTier;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace FlightWCFService
{
    public class FlightServiceTCP : IFlightService
    {
  
        public String Book(List<int> legIDS, List<Backend.Passenger> passengers)
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();

            return booking.Book(legIDS, passengers);
        }



        public String SayHello()
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();
            return booking.SayHelloTest();
        }







        //Returns null if no flights were found

        public System.Collections.Generic.List<Backend.Flight> FlightSearch(string departAirp, string arrivalAirp, string date, int numberOfPassengers)
        {
            FlightBooking booking = FlightBooking.GetFlightBookingObj();

            return booking.FlightSearch(new Backend.Airport(departAirp), new Backend.Airport(arrivalAirp), date, numberOfPassengers);
        }
    }
}
